import 'package:flutter/material.dart';
import 'package:flutter_chat_ui/pages/chat_room_controller.dart';
import 'package:flutter_chat_ui/utils/utils.dart';
import 'package:get/get.dart';

///
/// 聊天导航栏标题组件
///
class ChatAppBarTitleView extends GetView<ChatRoomController> {
  const ChatAppBarTitleView({
    super.key,
  });

  @override
  Widget build(BuildContext context) {
    return Obx(() => Text(
          controller.barTitle.value.fixAutoLines(),
          textAlign: TextAlign.center,
          maxLines: 2,
          style: const TextStyle(
            fontSize: 20,
            color: Colors.black,
            fontWeight: FontWeight.bold,
            overflow: TextOverflow.ellipsis,
          ),
        ));
  }
}
